<?php
include_once($_SERVER['DOCUMENT_ROOT']."/config.php");
include_once($gDOCUMENT_ROOT_SYSTEM.'include/dao/copyright.php');
include_once($gDOCUMENT_ROOT_SYSTEM.'include/dao/copyright_name_translation.php');
class copyrightAction
{
	private $copyright;
	private $copyright_name_translation;
	function __construct()
	{
		$this->copyright = new copyright();
		$this->copyright_name_translation = new copyright_name_translation();
	}
	public function AddFilmBluRay($data)
	{
		try
		{
			$film_id = $this->film_release_on_blu_ray->insert($data);
		}
		catch(Exception $e)
		{
			//echo 'Message: ' .$e->getMessage();
			return false;
		}
	}
	
	function getCopyrightIdAndName()
	{
		try
		{
			$column = array('copyright_id','en-US','zh-Hans-CN');
			$result = $this->copyright_name_translation->select('',$column);
			$id_name = array();
			foreach($result as $row)
			{
				$id_name[$row['copyright_id']] = $row['zh-Hans-CN'].'（'.$row['en-US'].'）';
			}
			return $id_name;
		}
		catch(Exception $e)
		{
			//echo 'Message: ' .$e->getMessage();
			return false;
		}
	}
	
	public function getFilmBluRayByFilmId($film_id,$column='*')
	{
		try
		{
			$blu_ray = $this->film_release_on_blu_ray->getByFilmId($film_id,$column);
			return $blu_ray;
		}
		catch(Exception $e)
		{
			//echo 'Message: ' .$e->getMessage();
			return false;
		}
	}
}

?>
